package com.hqx.oop.constructor;

import com.hqx.oop.constructor.Husband;
import com.hqx.oop.constructor.Wife;

public class CoupleTest {
    public static void main(String[] args) {
        Husband husband = new Husband();
        Wife wife = new Wife();
        husband.setName("伍六七");
        husband.setAge(18);
        husband.setWife(wife);
        wife.setName("梅花十三");
        wife.setAge(16);
        wife.setHusband(husband);

        System.out.println(husband.getName()+"今年"+husband.getAge()+"岁"+
                "妻子是"+husband.getWife().getName()+"\t"+husband.getWife().getAge()+"岁");
        System.out.println(wife.getName()+"今年"+wife.getAge()+"岁"+
                "妻子是"+wife.getHusband().getName()+"\t"+wife.getHusband().getAge()+"岁");
    }
}
